using UnityEngine;

[ExecuteInEditMode]
public class PresetsPlatformTemporary : MonoBehaviour
{
	public float fadeTime = 2f;

	private ControllerPlatformTemporary controller;

	private void LateUpdate()
	{
		if (Application.isEditor && !Application.isPlaying)
		{
			if (controller == null)
			{
				controller = base.gameObject.GetComponent<RemoteControl>().controller.GetComponent<ControllerPlatformTemporary>();
				fadeTime = controller.fadeTime;
			}
			SetValues();
		}
	}

	public void SetValues()
	{
		if (fadeTime < 0.1f)
		{
			fadeTime = 0.1f;
		}
		if (controller != null)
		{
			controller.fadeTime = fadeTime;
		}
	}
}
